from langchain_openai import ChatOpenAI
from langchain.schema import (
    AIMessage,
    HumanMessage,
    SystemMessage
)

chat = ChatOpenAI(temperature=0,
                  base_url="https://api.gpts.vin/v1",
                  api_key="sk-ELq6vE96xLlCHWjR21D8D93168604d2f975dF2572683464f")
print(chat.invoke([HumanMessage(content="Translate this sentence from English to French. I love programming.")]))

print("-----------------------------")

messages = [
    SystemMessage(content="You are a helpful assistant that translates English to French."),
    HumanMessage(content="Translate this sentence from English to French. I love programming.")
]
print(chat.invoke(messages))

print("-----------------------------")

batch_messages = [
    [
        SystemMessage(content="You are a helpful assistant that translates English to French."),
        HumanMessage(content="Translate this sentence from English to French. I love programming.")
    ],
    [
        SystemMessage(content="You are a helpful assistant that translates English to French."),
        HumanMessage(content="Translate this sentence from English to French. I love artificial intelligence.")
    ],
]
result = chat.generate(batch_messages)
print(result)